package org.example.business_logic.action;

import javafx.util.Pair;
import lombok.AllArgsConstructor;
import org.example.physics_engine.collision.detector.BasicCollisionDetector;
import org.example.physics_engine.collision.manifold.Manifold;
import org.example.physics_engine.body.PhysicsBody;

import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
public class BarrierAction implements UpdateListener {
    private final BasicCollisionDetector basicCollisionDetector = new BasicCollisionDetector();

    private final List<PhysicsBody> balls;

    private final List<PhysicsBody> barriers;


    @Override
    public List<Pair<Manifold, Pair<PhysicsBody, PhysicsBody>>> tick() {
        return basicCollisionDetector.detect(balls, barriers, new ArrayList<>());
    }
}
